﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PedidoCompraEstiloAdd.ascx.cs"
    Inherits="Emporium_Web.PedidoCompraEstiloAdd" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

 <script type="text/javascript">
     var hdnSeleccionPedidoCompraId = '<%= this.hdnSeleccion.ClientID %>';


     function CheckPedidoCompraSearch(itemId) {
         Regs = document.getElementById(hdnSeleccionPedidoCompraId);
         Regs.value = itemId;        
     }

     function HayUnoPedidoCompraSeleccionado() {
         Regs = document.getElementById(hdnSeleccionPedidoCompraId);

         if (Regs.value == '') {
             alert('Seleccione un registro');
             return false;
         }
         return true;
     }
</script>

<asp:Button ID="btnTarget" style="display:none" runat="server" Text="Button" />


<asp:Panel ID="ModalPanelPedidoCompra" runat="server" Width="700px" Height="440px" BackColor="White" style=" z-index:1002; display:none; background-color:White;  " >

<div>
    
    <article class="container_12" >
		<section class="grid_12">

			<div class="block-border" style="background-color:White; z-index:149;">
				<h1>Orden de Producción</h1>
                <br />
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <div style="width: 100%; padding-top: 0px; background-color:White; z-index:151;">
                        <div style="width: 100%; height: 40px; background-color:White; float: inherit;">
                            <div style="width: 100px; float: left;background-color:White;">
                                <label>Descripción</label>
                            </div>
                            <div align="left" style="width: 70%; float: left;">
                                <asp:TextBox ID="txtDescripcion" name="simple-required" runat="server" Width="300px"></asp:TextBox>
                                  <asp:LinkButton ID="btnBuscar" runat="server" Text="Buscar" CssClass="button red"
                                    OnClick="btnBuscar_Click" />
                            </div>
                        </div>                        
                    </div>

					<ul class="message error no-margin" runat="server" id="errorMessage">
					    <li><asp:Label runat="server" ID="lblErrorMessage"></asp:Label></li>
					</ul>                    

                    <div class="block-controls" style="padding: 10px; background-color:White; z-index:152; margin:0px;">
                    <emporium:pager ID="gvPager" Width="700px"  runat="server" Visible="false" PageSize="5" OnPageChanged="gvPagerPageChanged" />
                    </div>


                    <asp:HiddenField ID="hdnSeleccion" runat="server" />

                    <div class="no-margin" 
                        style=" margin: 0px; padding: 0px; width:100%;">
					<asp:GridView ID="gvPedidoCompras" runat="server" SkinID="gridviewSkin" 
                            PageSize="5" AutoGenerateColumns = "false"
                            Width="100%" DataKeyNames = "PedCom_Id" 
                            onrowcommand="gvPedidoCompras_RowCommand" onrowdatabound="gvPedidoCompras_RowDataBound" 
                              >

                            <Columns>                   
							<asp:TemplateField>
                                <ItemTemplate>
                                      <input id="rbSelect" type="radio" name="selectGroup" value="rbSelect" onclick="javascript:CheckPedidoCompraSearch('<%# Eval("PedCom_Id") %>','hdnSeleccionPedidoCompra');"/>
								</ItemTemplate>
								<ItemStyle HorizontalAlign="Left" Width="5%" />
							</asp:TemplateField>
                             <asp:TemplateField HeaderText="Pedido"  HeaderStyle-HorizontalAlign="Left">
                                <HeaderStyle HorizontalAlign="Left" ForeColor="White" Font-Bold="true"></HeaderStyle>                               
                                <ItemTemplate>
                                    <%# Eval("PedCom_Id", "{0:00000}")%>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" Width="15%" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="F.Registro"  HeaderStyle-HorizontalAlign="Left">                                
                                <ItemTemplate> 
                                    <asp:Label ID="lblFechaRegistro" runat="server" Text='<%# Bind("PedCom_FechaRegistro","{0:dd/MM/yyyy}") %>'></asp:Label> 
                                </ItemTemplate> 
                            </asp:TemplateField> 
                            <asp:TemplateField HeaderText="F.Comercial"  HeaderStyle-HorizontalAlign="Left">                                
                                <ItemTemplate> 
                                    <asp:Label ID="lblFechaComercial" runat="server" Text='<%# Bind("PedCom_FechaComercial","{0:dd/MM/yyyy}") %>'></asp:Label> 
                                </ItemTemplate> 
                            </asp:TemplateField> 
                            <asp:TemplateField HeaderText="F.Entrega"  HeaderStyle-HorizontalAlign="Left">                                
                                <ItemTemplate> 
                                    <asp:Label ID="lblFechaEntrega" runat="server" Text='<%# Bind("PedCom_FechaEntrega","{0:dd/MM/yyyy}") %>'></asp:Label> 
                                </ItemTemplate> 
                            </asp:TemplateField>
                           <asp:TemplateField HeaderText="Prs.Sol."  HeaderStyle-HorizontalAlign="Left">                                
                                 <ItemTemplate>
                                    <asp:Label ID="lblPrendasSol" runat="server"></asp:Label> 
                                </ItemTemplate>
                            </asp:TemplateField>
                             <asp:TemplateField HeaderText="Prs.Prod."  HeaderStyle-HorizontalAlign="Left">                                
                                 <ItemTemplate>
                                    <asp:Label ID="lblPrendasProd" runat="server"></asp:Label> 
                                </ItemTemplate>
                            </asp:TemplateField>
						</Columns> 
						  
						<PagerSettings Visible="false" />
                        
					</asp:GridView> 
                    
                  
                  </div>
                    
                    
                     <ul class="message no-margin" style="  width:650px; margin-left:0px;">
                    <li>
                        <asp:Label ID="lblMensajeGridFooter" runat="server"></asp:Label>
                    </li>
				    </ul>

                   </ContentTemplate>
    </asp:UpdatePanel>

                    
			
			</div>
	
	</section>
                </article>
</div>

    	<!-- footer para cerrar el PedidoCompra bien-->
				<div align="left" style="width:100%; position:absolute; left:25px;">
                <asp:Button ID="btnAceptar" runat="server" Text="Aceptar" CssClass="button" 
                        onclick="btnAceptar_Click" OnClientClick="return HayUnoPedidoCompraSeleccionado();"/>
                <asp:Button ID="btnCancelar" runat="server" Text="Cancelar" CssClass="button" />
				</div>

</asp:Panel>
<ajaxToolkit:ModalPopupExtender ID="mpeBusquedaPedidoCompra" runat="server" TargetControlID="btnTarget"
    PopupControlID="ModalPanelPedidoCompra" CancelControlID = "btnCancelar"
    BackgroundCssClass = "modalBackgroundDiv" DropShadow = "true" />

